package cn.itcast.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.itcast.bean.Users;
import cn.itcast.service.UserService;

public class LoginServlet extends HttpServlet {

	
	private static final long serialVersionUID = 1L;


	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		Users u = new Users();
		u.setName(request.getParameter("name"));
		u.setPassword(request.getParameter("password"));
		
		UserService us = new UserService();
		us.finduserdao(u);
		System.out.println("sssss");
		request.getRequestDispatcher("person.jsp").forward(request, response);
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request,response);
		
	}

}
